<!--suppress ALL -->
<include file="./Template/header.html" />
<link rel="stylesheet" type="text/css" href="/Template/css/myIcoin.css?v=2">
<script type="text/javascript">

    $(function() {

        //初始化页面配置
        initPage("我的I币");

        var app = new Vue({
            el: '#container',
            data: {
                finishedProductList: [],
            },
            methods: {
                updateInfo: function() {
                    window.location.href = "/wechat/userCenter/myInfo";
                },
                order: function(id) {
                    window.location.href = "/wechat/order/index/id/"+id;
                },
                orderList: function() {
                    window.location.href = "/wechat/finishedProduct/orderList";
                },
            }
        })
        function getClubfootProductList(classId, keyword) {

            $.ajax({
                url:"/wechat/clubfoot/clubfootProductList",
                type:"post",
                data:{
                    classId: classId,
                    keyword: keyword
                },
                dataType:"JSON",
                beforeSend:function(){
                    $("#loadingToast").show();
                },
                complete:function(){
                    $('#loadingToast').hide();
                },
                success:function(data){
                    app.finishedProductList = data;
                    setTimeout(function() {
                        $(".ui-item.measure-info img").bind("click", function() {
                            var upUrl = "/Template/images/icon-up.png";
                            var downUrl = "/Template/images/icon-down.png";
                            $(this).parent().next().toggle();
                            if($(this).attr("src") == upUrl) {
                                $(this).attr("src", downUrl);
                            } else {
                                $(this).attr("src", upUrl);
                            }
                        });
                        $(".ui-item.measure-info img").each(function() {
                            $(this).trigger("click");
                        });
                    },200);
                },
            })
        }
        $(".search-box").change(function() {
            var value = $(this).find("option:selected").text();
            $(this).prev().attr('placeholder',value);
        });


        $("select[name=classId]").change(function() {

            var classId = $(this).val();
            var keyword = $("input[name=keyword]").val();
            getClubfootProductList(classId,keyword);

        });

        $("input[name=keyword]").change(function() {
            var classId = $("select[name=classId]").val();
            var keyword = $(this).val();
            getClubfootProductList(classId, keyword);

        });

        $("img[name=searchImg]").click(function() {

            var classId = $("select[name=classId]").val();
            var keyword = $("input[name=keyword]").val();
            getClubfootProductList(classId, keyword);

        });

        getClubfootProductList("{$classId}","{$keyword}");

        var value = $("select[name=classId]").find("option:selected").text();
        $("select[name=classId]").prev().attr('placeholder',value);
    });


</script>
<div class="container" id="container">
    <div class = "search">
        <div class="class-search">
            <span class="class-select">目前拥有</span>
            <img class="lefthint" src="/Template/images/icon-icoin.png" alt="">
            <span class="class-select">币：</span>
            <span style="color: #d95825">{$info.point}</span>
        </div>
        <if condition="$info['valid'] neq '1'">
            <button class="info-button" v-on:click="updateInfo()">完善个人资料</button>
        </if>
    </div>
    <div class="finishedProduct-detail">
        <div class="finishedProduct-info" v-for="list in finishedProductList">
            <div class="have-padding">
                <div class="product-info">
                    <img class="finishedProduct-img" src="{{list.image_url}}" alt="product">
                    <div class="detail-info">
                        <p class="product-name"><button v-on:click="order(list.product_id)">下 单</button></p>

                        <p class="product-price"><span style="color: #d92f3b;">￥{{list.price}}</span> / {{list.unit}}</p>

                        <!--<p class="product-class">{{list.class_name}}</p>-->
                        <p class="product-size">规格：{{list.size}} </p>
                    </div>
                    <!--p class="sum">共{{order.number}}件商品 合计:<span style="color: #d92f3b;">￥{{order.price}}</span></p-->
                </div>
                <div class="finishedProduct-detail-info">
                    <div class="ui-item measure-info">
                        <span class="item-class">{{list.show_name}}</span>
                        <span class="item-detailname">详细信息</span>
                        <img class="icon-up" src="/Template/images/icon-up.png" alt="">
                    </div>
                    <div>
                        <div class="ui-item ">
                            <!--<span class="item-left">说明</span>-->
                            <span class="item-all">{{list.function}}</span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="line"></div>
        </div>

    </div>

        <div class="qiandao-bottom">
            <div class="qiandao-rule-list">
                <h4>I币介绍：</h4>
                <p>I币是您在希卫康公众号中完善个人资料、参与“马蹄足交流答疑群“中相关活动后获得的奖励，可用于在平台购买IOWA支具或配件时使用，在消费时一个I币可以抵1元现金使用。</p>
            </div>
            <!--div class="qiandao-rule-list">
                <h4>其他规则：</h4>
                <p>1. 首次完善个人资料，并填写实际信息将获得50个I币奖励。</p>
                <p>2. 推荐好友加入“马蹄足交流答疑群”并且该好友成功购买IOWA支具后，推荐者将获得200个I币奖励。</p>
                <p>3. 在“马蹄足交流答疑群”中热心帮助其他病友解决问题并且得到专家认可，每月将获得50个<img class="qiandao-coin" src="/Template/images/icon-icoin.png">币奖励。</p>
                <p>3. 获得的奖励不能直接提现，只能在购买IOWA支具或配件是使用，在消费时1个I币可以抵1元现金使用。</p>
            </div-->
        </div>


</div>

<include file="./Template/footer.html" />

